<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http：//www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
</head>
<body>
	<form id="formTab2">
		<script type="text/javascript">
			$(function() {
				$("#ABA01C").autocomplete(dic.ICD10, {
					autoFill : false,
					matchContains : true,
					formatItem : function(item) {
						return item.code + "(" + item.name + ")";
					},
					formatResult : function(item, i, max) {
						return item.code;
					},
					formatMatch : function(row, i, max) {
						return row.code + " " + row.name + " " + row.pym;
					}
				}).result(function(event, item) {
					item = item || {};
					$("#ABA01N").val(item.name);
					$("#ABA01N").validatebox("validate");
				});
				$("#ABA01N").autocomplete(dic.ICD10, {
					autoFill : false,
					matchContains : true,
					formatItem : function(item) {
						return item.name + "(" + item.code + ")";
					},
					formatResult : function(item, i, max) {
						return item.name;
					},
					formatMatch : function(item) {
						return item.code + " " + item.name + " " + item.pym
					}
				}).result(function(event, item) {
					item = item || {};
					$("#ABA01C").val(item.code);
					$("#ABA01C").validatebox("validate");
				});
			});
		</script>
		<fieldset>
			<legend> 门急诊诊断信息 </legend>
			<table class="layout-table">
				<colgroup>
					<col width="20%" />
					<col width="30%" />
					<col width="20%" />
					<col width="30%" />
				</colgroup>
				<tbody>
					<tr>
						<td align="right"><label for="ABA01C">门(急)诊诊断编码(ICD-10)：</label></td>
						<td><input id="ABA01C" name="ABA01C" type="text"
							class="easyui-validatebox" validType="fixedin[dic.ICD10,'code']" />
						</td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td align="right"><label for="ABA01N">门（急）诊诊断名称：</label></td>
						<td colspan="3"><input id="ABA01N" name="ABA01N" type="text"
							class="easyui-validatebox longtext"
							validType="fixedin[dic.ICD10,'name']" /></td>
					</tr>
				</tbody>
			</table>
		</fieldset>
		<script type="text/javascript">
			$(function() {
				$("#ABC01C").autocomplete(dic.ICD10, {
					//mustMatch: true,
					autoFill : false,
					matchContains : true,
					formatItem : function(item) {
						return item.code + "(" + item.name + ")";
					},
					formatResult : function(item, i, max) {
						return item.code;
					},
					formatMatch : function(row, i, max) {
						return row.code + " " + row.name + " " + row.pym;
					}
				}).result(function(event, item) {
					item = item || {};
					$("#ABC01N").val(item.name);
					$("#ABC01N").validatebox("validate");
					//肿瘤作为主诊时，编码范围在C00~D48,病理诊断编码为必填。
					if (item.code && item.code >= "C00" && item.code < "D49") {
						$("#ABF01C,#ABF01N").validatebox({
							required : true
						});
						$("#ABF01C,#ABF01N").validatebox("validate");
					} else {
						$("#ABF01C,#ABF01N").validatebox({
							required : false
						});
						$("#ABF01C,#ABF01N").validatebox("validate");
					}
					//损伤中毒作为主诊时，编码范围在S00 – T98, 损伤外部原因必填
					if (item.code && item.code >= "S00" && item.code < "T99") {
						$("#ABG01C,#ABG01N").validatebox({
							required : true
						});
						$("#ABG01C,#ABG01N").validatebox("validate");
					} else {
						$("#ABG01C,#ABG01N").validatebox({
							required : false
						});
						$("#ABG01C,#ABG01N").validatebox("validate");
					}
				});
				$("#ABC01N").autocomplete(dic.ICD10, {
					//mustMatch: true,
					autoFill : false,
					matchContains : true,
					formatItem : function(item) {
						return item.name + "(" + item.code + ")";
					},
					formatResult : function(item, i, max) {
						return item.name;
					},
					formatMatch : function(item) {
						return item.code + " " + item.name + " " + item.pym;
					}
				}).result(function(event, item) {
					item = item || {};
					$("#ABC01C").val(item.code);
					$("#ABC01C").validatebox("validate");
					//肿瘤作为主诊时，编码范围在C00~D48,病理诊断编码为必填。
					if (item.code && item.code >= "C00" && item.code < "D49") {
						$("#ABF01C,#ABF01N").validatebox({
							required : true
						});
						$("#ABF01C,#ABF01N").validatebox("validate");
					} else {
						$("#ABF01C,#ABF01N").validatebox({
							required : false
						});
						$("#ABF01C,#ABF01N").validatebox("validate");
					}
					//损伤中毒作为主诊时，编码范围在S00 – T98, 损伤外部原因必填
					if (item.code && item.code >= "S00" && item.code < "T99") {
						$("#ABG01C,#ABG01N").validatebox({
							required : true
						});
						$("#ABG01C,#ABG01N").validatebox("validate");
					} else {
						$("#ABG01C,#ABG01N").validatebox({
							required : false
						});
						$("#ABG01C,#ABG01N").validatebox("validate");
					}
				});
			});
		</script>
		<fieldset>
			<legend> 出院主要诊断信息 </legend>
			<table class="layout-table">
				<colgroup>
					<col width="20%" />
					<col width="30%" />
					<col width="20%" />
					<col width="30%" />
				</colgroup>
				<tbody>
					<tr>
						<td align="right"><label for="ABC01C">出院时主要诊断编码(ICD-10)：</label></td>
						<td><input id="ABC01C" name="ABC01C" type="text"
							class="easyui-validatebox" required="true"
							validType="fixedin[dic.ICD10,'code']" /></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td align="right"><label for="ABC01N">出院主要诊断名称：</label></td>
						<td colspan="3"><input id="ABC01N" name="ABC01N" type="text"
							class="easyui-validatebox longtext"
							validType="fixedin[dic.ICD10,'name']" required="true" /></td>
					</tr>
					<tr>
						<td align="right"><label for="ABC03C">入院病情：</label></td>
						<td><input id="ABC03C" name="ABC03C" type="text"
							class="easyui-combobox" data-options="data:dic.ruYuanBingQing"
							panelHeight="auto" required="true"
							validType="comboboxfixed['ABC03C']" /></td>
						<td></td>
						<td></td>
					</tr>
				</tbody>
			</table>
		</fieldset>
		<script type="text/javascript">
			$(function() {
				$('#ABDS').initGrid();
			});
			function ABD01C_resultHandler(event, item) {
				item = item || {};
				var target = event.currentTarget;
				var el = $(target).parent().parent().parent().parent().parent()
						.parent().next().find("input");
				el.val(item.name);
				el.validatebox("validate");
			}
			function ABD01N_resultHandler(event, item) {
				item = item || {};
				var target = event.currentTarget;
				var el = $(target).parent().parent().parent().parent().parent()
						.parent().prev().find("input");
				el.val(item.code);
				el.validatebox("validate");
			}
			function rybq_Formatter(value) {
				for ( var i = 0; i < dic.ruYuanBingQing.length; i++) {
					if (dic.ruYuanBingQing[i].value == value)
						return dic.ruYuanBingQing[i].text;
				}
				return value;
			}
		</script>
		<fieldset>
			<legend>出院其他诊断信息</legend>
			<table id="ABDS" style="height: 180px;" title="出院其他诊断信息"
				singleSelect="true" rownumbers="true">
				<thead>
					<tr>
						<th field="ABD01C" width="200" align="center"
							editor="{type:'autocompletebox',options:{source:dic.ICD10,autoFill : false,matchContains: true,formatItem: function(item){return item.code+'('+item.name+')';},formatResult:function(item,i,max){return item.code;},formatMatch:function(row,i,max){return row.code+row.name+row.pym},resultHandler:ABD01C_resultHandler,required:true,validType:'fixedin[dic.ICD10,\'code\']'}}">
							出院时其他诊断编码(ICD-10)</th>
						<th field="ABD01N" width="400" align="center"
							editor="{type:'autocompletebox',options:{source:dic.ICD10,autoFill : false,matchContains: true,formatItem: function(item){return item.name+'('+item.code+')';},formatResult:function(item,i,max){return item.name;},formatMatch:function(row,i,max){return row.code+row.name+row.pym},resultHandler:ABD01N_resultHandler,required:true,validType:'fixedin[dic.ICD10,\'name\']'}}">
							出院其他诊断名称</th>
						<th field="ABD03C" width="100" align="center"
							formatter="rybq_Formatter"
							editor="{type:'combobox',options:{required:true,data:dic.ruYuanBingQing,panelHeight:'auto',editable:false}}">
							入院病情</th>
					</tr>
				</thead>
			</table>
		</fieldset>
		<script type="text/javascript">
		$(function() {
			$("#ABF01C").autocomplete(dic.BLZD, {
				autoFill : false,
				matchContains : true,
				formatItem : function(item) {
					return item.code + "(" + item.name + ")";
				},
				formatResult : function(item, i, max) {
					return item.code;
				},
				formatMatch : function(row, i, max) {
					return row.code + " " + row.name + " " + row.pym;
				}
			}).result(function(event, item) {
				item = item || {};
				$("#ABF01N").val(item.name);
				$("#ABF01N").validatebox("validate");
			});
			$("#ABF01N").autocomplete(dic.BLZD, {
				autoFill : false,
				matchContains : true,
				formatItem : function(item) {
					return item.name + "(" + item.code + ")";
				},
				formatResult : function(item, i, max) {
					return item.name;
				},
				formatMatch : function(item) {
					return item.code + " " + item.name + " " + item.pym;
				}
			}).result(function(event, item) {
				item = item || {};
				$("#ABF01C").val(item.code);
				$("#ABF01C").validatebox("validate");
			});
		});
		</script>
		<fieldset>
			<legend> 病理诊断信息 </legend>
			<table class="layout-table">
				<colgroup>
					<col width="20%" />
					<col width="30%" />
					<col width="20%" />
					<col width="30%" />
				</colgroup>
				<tbody>
					<tr>
						<td align="right"><label for="ABF01C">病理诊断编码(M码)：</label></td>
						<td><input id="ABF01C" name="ABF01C" type="text"
							class="easyui-validatebox" validType="fixedin[dic.BLZD,'code']" />
						</td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td align="right"><label for="ABF01N">病理诊断名称：</label></td>
						<td colspan="3"><input id="ABF01N" name="ABF01N" type="text"
							class="easyui-validatebox longtext"
							validType="fixedin[dic.BLZD,'name']" /></td>
					</tr>
					<tr>
						<td align="right"><label for="ABF04">病理号：</label></td>
						<td><input id="ABF04" name="ABF04" type="text"
							class="easyui-validatebox" validType="length[0,50]" /></td>
						<td align="right"><label for="ABF02C">最高诊断依据代码：</label></td>
						<td><input id="ABF02C" name="ABF02C" type="text"
							class="easyui-combobox" data-options="data:dic.diagnosticEvidence"
							validType="comboboxfixed['ABF02C']" /></td>
					</tr>
					<tr>
						<td align="right"><label for="ABF03C">分化程度编码：</label></td>
						<td><input id="ABF03C" name="ABF03C" type="text"
							class="easyui-combobox" data-options="data:dic.fenHuaChengDu"
							validType="comboboxfixed['ABF03C']" /></td>
						<td></td>
						<td></td>
					</tr>
				</tbody>
			</table>
		</fieldset>
		<fieldset>
			<legend> 损伤中毒诊断信息 </legend>
			<table class="layout-table">
				<colgroup>
					<col width="20%" />
					<col width="30%" />
					<col width="20%" />
					<col width="30%" />
				</colgroup>
				<tbody>
					<tr>
						<td align="right"><label for="ABG01C">损伤和中毒外部原因编码(ICD-10)：</label></td>
						<td><input id="ABG01C" name="ABG01C" type="text"
							class="easyui-validatebox" validType="fixedin[dic.ICD10,'code']" />
						</td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td align="right"><label for="ABG01N">损伤和中毒外部原因名称：</label></td>
						<td colspan="3"><input id="ABG01N" name="ABG01N" type="text"
							class="easyui-validatebox longtext"
							validType="fixedin[dic.ICD10,'name']" /></td>
					</tr>
				</tbody>
			</table>
		</fieldset>
		<script type="text/javascript">
		$(function(){
			$("#ABG01C").autocomplete(dic.ICD10, {
				autoFill: false,
				matchContains:true,
				formatItem: function(item){
					return item.code+"("+item.name+")";
				},
				formatResult:function(item,i,max){
					return item.code;
				},
				formatMatch:function(row,i,max){
					return row.code+" "+row.name+" "+row.pym;
				}
			}).result(function(event, item) {
				item = item||{};
				$("#ABG01N").val(item.name);
				$("#ABG01N").validatebox("validate");
			});
			$("#ABG01N").autocomplete(dic.ICD10, {
				autoFill: false,
				matchContains:true,
				formatItem: function(item){
					return item.name+"("+item.code+")";
				},
				formatResult:function(item,i,max){
					return item.name;
				},
				formatMatch:function(item){
					return item.code+ " " +item.name+ " " +item.pym;
				}
			}).result(function(event, item){
				item = item||{};
				$("#ABG01C").val(item.code);
				$("#ABG01C").validatebox("validate");
			});
		});
		</script>
		<fieldset>
			<legend> 肿瘤分期 </legend>
			<table class="layout-table">
				<colgroup>
					<col width="20%" />
					<col width="30%" />
					<col width="20%" />
					<col width="30%" />
				</colgroup>
				<tbody>
					<tr>
						<td align="right"><label for="ABH01C">肿瘤分期是否不详：</label></td>
						<td><input id="ABH01C" name="ABH01C" type="text"
							class="easyui-combobox" data-options="data:dic.bool"
							panelHeight="auto" validType="comboboxfixed['ABH01C']" /></td>
						<td align="right"><label for="ABH0201C">肿瘤分期 T：</label></td>
						<td><input id="ABH0201C" name="ABH0201C" type="text"
							class="easyui-combobox" data-options="data:dic.TNM_T"
							panelHeight="auto" validType="comboboxfixed['ABH0201C']" /></td>
					</tr>
					<tr>
						<td align="right"><label for="ABH0202C">肿瘤分期 N：</label></td>
						<td><input id="ABH0202C" name="ABH0202C" type="text"
							class="easyui-combobox" data-options="data:dic.TNM_N"
							panelHeight="auto" validType="comboboxfixed['ABH0202C']" /></td>
						<td align="right"><label for="ABH0203C">肿瘤分期 M：</label></td>
						<td><input id="ABH0203C" name="ABH0203C" type="text"
							class="easyui-combobox" data-options="data:dic.TNM_M"
							panelHeight="auto" validType="comboboxfixed['ABH0203C']" /></td>
					</tr>
					<tr>
						<td align="right"><label for="ABH03C">0～Ⅳ肿瘤分期：</label></td>
						<td><input id="ABH03C" name="ABH03C" type="text"
							class="easyui-combobox" data-options="data:dic.zhongLiuFenQi"
							panelHeight="auto" validType="comboboxfixed['ABH03C']" /></td>
						<td></td>
						<td></td>
					</tr>
				</tbody>
			</table>
			<script type="text/javascript">
				$(function(){
					$("#ABH01C").combobox({
						onSelect: function(record){
							var val = $(this).combobox("getValue");
							if(val=="2"){
								$("#ABH0201C,#ABH0202C,#ABH0203C,#ABH03C").combobox({required:true});
							}else{
								$("#ABH0201C,#ABH0202C,#ABH0203C,#ABH03C").combobox({required:false});
							}
						}
					});
				});
			</script>
		</fieldset>
	</form>
</body>
</html>
